package com.licheedev.demo;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;

import com.licheedev.demo.base.BaseActivity;

public class ChooseModeActivity extends BaseActivity {


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choose_mode);
        findViewById(R.id.btn_serial_port).setOnClickListener(onClickListener);
    }


    private final View.OnClickListener onClickListener = v -> {
        int id = v.getId();
        if (id == R.id.btn_serial_port) {
            startActivity(MainActivity.newIntent(ChooseModeActivity.this, MainActivity.MODE_SERIAL));
        } else if (id == R.id.btn_tcp) {
            startActivity(MainActivity.newIntent(ChooseModeActivity.this, MainActivity.MODE_TCP));
        }
        finish();
    };

}
